package DailyPractice.Day1;

import java.util.Arrays;
import java.util.Scanner;

/**
 * @author lumin
 * @date 2022/04/17 21:13
 **/
public class Num1 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int k = sc.nextInt();
        int[] b = new int[3 * k];
        for(int j = 0; j < b.length;j++) {
            b[j] = sc.nextInt();
        }
        Arrays.sort(b);
        int sum = 0;
        for (int i = 0; i < k; i++) {
            sum += b[b.length - (2*(i+1))];
        }
        System.out.println(sum);
    }
}